#! /usr/local/bin/gforth-fast

\ HTML4.0标签定义
\ 主体标签
: html. ." <html>" ;
: .html ." </html>" ;
: head. ." <head>" ;
: .head ." </head>" ;
: body. ." <body>" ;
: .body ." </body>" ;
: title. ." <title>" ;
: .title ." </title>"  ;
: #html ." <!-- " ; \ html注解开始
: html# ." -->" ; \ html注解完
\ <meta name="description" content="Free Web tutorials" />
: meta.description ( content -- )
    ." <meta name=" 34 emit
    ." description" 34 emit
    ."  content=" 34 emit type 34 emit ." >"
    ;
\ <meta name="keywords" content="HTML,CSS,XML,JavaScript" />
: meta.keywords ( content -- )
    ." <meta name=" 34 emit
    ." keywords" 34 emit
    ."  content=" 34 emit type 34 emit ." >"
    ;

\ <meta name="author" content="Hege Refsnes" />
: meta.author ( content -- )
    ." <meta name=" 34 emit
    ." author" 34 emit
    ."  content=" 34 emit type 34 emit ." >"
    ;

\ <meta http-equiv="Content-Type" content="text/html;charset=uft-8" />
: meta.http-equiv ( content -- )
    ." <meta http-equiv=" 34 emit
    ." Content-type" 34 emit
    ."  content=" 34 emit type 34 emit ." >"
    ;

\ 表示层标签
: h1. ." <h1>" ;
: .h1 ." </h1>" ;
: h2 ." <h2>" ;
: .h2 ." </h2>" ;
: h3. ." <h3>" ;
: .h3 ." </h3>" ;
: h4. ." <h4>" ;
: .h4 ." </h4>" ;
: h5. ." <h5>" ;
: .h5 ." </h5>" ;
: h6. ." <h6>" ;
: .h6 ." </h6>" ;
: p. ." <p>" ;
: .p ." </p>" ;
: b. ." <b>" ;
: .b ." </b>" ;
: br ." <br>" ;
: hr ." <hr>" ;

\ 超级链接:
\ 1.转向其他页面 <a href="url">content</a>
: a.go ( content url -- )
    ."  <a href=" 34 emit type 34 emit ." >"
    type ." </a>"
    ;
\ 2.新建其他页面 <a href="url" target="_blank">content</a>
: a.blank ( content url -- )
    ." <a href=" 34 emit type 34 emit
    ."  target=" 34 emit ." _blank" 34 emit ." >"
    type ." </a>"
    ; 
\ 3.转向页内标签 
\ <a name="label">content</a>
: a.label ( content lable -- )
    ." <a name=" 34 emit type 34 emit
    ." >" type ." </a>"
    ; 

\ <a href="#label">Any content</a>
: a.go-label ( content lable -- )
    ." <a href=" 34 emit type 34 emit
    ." >" type ." </a>"
     ;

\ 关闭窗口
: a.close ( -- )
    ." <a href=" 34 emit
    ." JavaScript:window.close()" 34 emit
    ." >关闭当前窗口或标签</a>"
     ;
\ : a.. ." <a href=" 34 emit ;
\ : .a ." </a>" ;
\ : .> ." >" ;
\ 表格
\ <table border="1">
\ <tr>
\ <td>row 1, cell 1</td>
\ <td>row 1, cell 2</td>
\ </tr>
\ <tr>
\ <td>row 2, cell 1</td>
\ <td></td>
\ </tr>
\ </table> 
: table. ." <table border='1'>" ;
: .table ." </table>" ;
: tr ." <tr>" ;
: td. ." <td>" ;
: .td ." </td>" ;


\ 图片
\ <img src="w3schools.jpg" width="104" height="142" />

\ 窗体元素
\ : form.. ." <form " ;
\ : .form ." </form>" ;
\ : action ."  action=" ;
\ : methold ."  methold=" ;
\ <input type=text name=姓名><br>
\ : input     ." <input " end> ;
\ : kind      ."  type=" ;
\ : name      ."  name=" ;
\ : value     ."  value=" ;

\ get parameters from links
: params s" QUERY_STRING" getenv ; 
\ simple code 


